 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Browser;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using Lib.Helper;
using MSIACCSL2.ViewModels;
using WcfService1.DTO;

namespace MSIACCSL2.Views.PurchaseInvoice
{
    public partial class Index : Page
    {

        public PurchaseInvoiceWrapViewModel WrapViewModel
        {
            get
            {
                return this.Resources["POW"] as PurchaseInvoiceWrapViewModel;
            }
        }

        public PurchaseInvoiceViewModel ViewModel
        {
            get
            {
                return this.DataContext as PurchaseInvoiceViewModel;
            }
        }

        public Index()
        {
            InitializeComponent();
            PurchaseInvoiceViewModel.OnSearchCompleted = (x) =>
                                          {
                                              this.DataContext = (PurchaseInvoiceViewModel)x;
                                          };
        }

        private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var pi = (sender as Button).DataContext as PurchaseInvoiceDTO;
            //GlobalVar.OkaSocket.SendMessage("PurchaseInvoice|" + pi.PINo);
            MyButton button = new MyButton(GlobalVar.ReportUrl + "PI.aspx?no=" + HttpUtility.UrlEncode(pi.PINo));
            button.ClickMe();
        }

    
    }
}


